package com.eonmind.common.provider.entity.knowledge;

import com.eonmind.common.contract.enums.DelEnum;
import com.eonmind.common.contract.enums.knowledge.KnowledgeTypeEnum;
import com.eonmind.common.contract.timer.Timer;
import com.mongoplus.annotation.ID;
import com.mongoplus.annotation.collection.CollectionName;
import com.mongoplus.annotation.index.MongoIndex;
import com.mongoplus.annotation.index.MongoTextIndex;
import com.mongoplus.enums.IdTypeEnum;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.FieldNameConstants;

/**
 * 知识库
 */
@Data
@CollectionName("knowledge")
@MongoTextIndex(fields = {"name"})
@FieldNameConstants
@ToString
public class Knowledge {
    /**
     * 知识库ID
     */
    @ID(type = IdTypeEnum.AUTO)
    private Long id;

    /**
     * 用户ID
     */
    @MongoIndex
    private Long userId = 0L;

    /**
     * 知识库名称
     */
    @MongoIndex
    private String name = "";

    /**
     * 类别名称
     */
    @MongoIndex
    private Integer knowledgeType = KnowledgeTypeEnum.DOCUMENT.getCode();

    /**
     * 对应百炼知识库名称
     */
    private String indexName = "";

    /**
     * 百炼知识库索引
     **/
    private String indexId;

    /**
     * 知识库描述
     */
    private String desc = "";

    /**
     * 删除状态
     */
    @MongoIndex
    private Integer del = DelEnum.UN_DEL.getCode();

    /**
     * 创建时间
     */
    private Long createTime = Timer.currentTimestamp();

    /**
     * 更新时间
     */
    private Long updateTime = Timer.currentTimestamp();

}
